package com.qingke.p2;

public class Employee implements Comparable<Employee>{
	private String name;
	private String id;
	private double salary;
	public static int count=0;
	public Employee(){
		count++;
	}
	public Employee(String name,double salary){
		this();
		this.name=name;
		this.id=""+count;
		this.salary=salary;
	}
	public String toString() {
		return "Employee [name=" + name + ", id=" + id + ", salary=" + salary + "]";
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public double getSalary() {
		return salary;
	}
	public void setSalary(double salary) {
		this.salary = salary;
	}
	public int compareTo(Employee o) {
		return (int) (this.salary-o.salary);
	}
}
